<%@ page language="java" contentType="text/html; charset=utf-8"  pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/util_file/common.jspf"%> 
<script type="text/javascript">
$(document).ready(function(){
	
	 $("#BtnOk").click(function(){
		if ($("#userpasswd").val() != $("#dbuserpasswd").val()) {
			alert("비밀번호가 알맞지 않습니다!");
		}else{
			if ($("#check_type").val() == 'modify'){
				$.nmTop().close();
				$.get('/jeons/review/insert?reno='+$("#reno_tmp").val(),function(data){
					$("#subpage_review").replaceWith(data);
				}); 
			}else{
				if(!confirm("정말로 삭제 하시겠습니까?")) return;
				$.get('/jeons/review/delete?reno='+$("#reno_tmp").val(),function(data){
					if (data == "true") {
						alert('삭제 되었습니다.');
					}else{
						alert('실패하였습니다.');
					}
					
					$("#qna_bdno").each(function(){
						$.get('/jeons/review/index?bdno='+$("#qna_bdno").val(), function(data){
							$("#subpage_review").replaceWith(data);
						});
					 });
				$.nmTop().close();
					
				}); 
			}
		}
	});   

	 //창 닫기
	$("#BtnClose").click(function(){
		$.nmTop().close();
	});
	 
	 //bdno 가져오기
	 
	
});
</script>
<input type="text" id="check_type" value="${board_type}" />
<input type="text" value="${reno}" id="reno_tmp"/>
<input type="text" id="dbuserpasswd" value="${userpasswd}"/>
<fieldset class="autotab ui-widget ui-widget-content ui-corner-all">
	<table border="0" width="500px" height="50">
		<tr>
			<td colspan="4" bgcolor="#ffffff" height="1"></td>
		</tr>
		<tr>
			<th height="24" align="center" colspan="2">비밀번호</th>
			<td><input type="text" id="userpasswd" name="userpasswd"/> </td>
			<td><button type="button" id="BtnOk">확인</button></td>
			<td><button type="button" id="BtnClose">닫기</button></td>
		</tr>
	</table>
</fieldset>